﻿//-----------------------------------------------------------------------
// <copyright file="RuleConfigurations.cs">
//     Copyright (c) Nicole Calinoiu. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;

using Microsoft.FxCop.Sdk;

namespace Bordecal.FxCop.Sdk
{
	[SuppressMessage("Microsoft.StyleCop.CSharp.DocumentationRules", "SA1600:ElementsMustBeDocumented",
			Justification = "False positive.")]
	internal static class RuleConfigurations
	{
		private static readonly IDictionary<Type, IRuleConfiguration> _dictionary = new Dictionary<Type, IRuleConfiguration>();

		internal static IRuleConfiguration GetConfiguration(IConfigurableRule rule)
		{
			IRuleConfiguration result;
			RuleConfigurations._dictionary.TryGetValue(rule.GetType(), out result);

			return result;
		}

		internal static void SetConfiguration(IConfigurableRule rule, IRuleConfiguration configuration)
		{
			RuleConfigurations._dictionary[rule.GetType()] = configuration;
		}
	}
}